import {
    set_edit_menu_form
} from './Constant';
import {deepCopy} from '../../../util/ObjUtil';

const defaultState = {
    menuTableData: [],
    isLoading: false,
    editMenuForm: null
};

export default (state = defaultState, action) => {

    if (action.type === set_edit_menu_form) {
        let newState = deepCopy(state);
        newState.editMenuForm = action.editMenuForm;
        return newState;
    }

    return state;
}